const { Schema } = require('mongoose');
const mongoose = require('./db');

const ArticleSchema = mongoose.Schema({
    title: { type: String, unique: true },
    cid: { type: Schema.Types.ObjectId }, // 分类 ID
    author_name: { type: String, default: "it营" },
    author_id: { type: Schema.Types.ObjectId }, // 用户ID
    description: String,
    content: String
})

module.exports = mongoose.model('Article', ArticleSchema, 'article');
